package com.umeng.analytics.pro;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import org.json.JSONObject;

import java.util.List;
import java.util.Map;

public class o {
    static final class o$a {
        private static final o a = new o();

        private o$a() {

        }

        static o a() {
            return a;
        }
    }

    private static Context a;

    private o() {

    }

    public void a(f arg5) {
        SQLiteDatabase v0_2;
        try {
            v0_2 = b.a(o.a).a();
            String v1 = com.umeng.analytics.pro.a.a(v0_2);
            String v2 = q.a(System.currentTimeMillis());
            if (!v1.equals("0")) {
                if (!v1.equals(v2)) {
                    com.umeng.analytics.pro.a.a(v0_2, arg5);
                } else {
                    com.umeng.analytics.pro.a.b(v0_2, arg5);
                }
            } else {
                arg5.a("faild", false);
            }
        } catch (Exception v0_1) {
            arg5.a(Boolean.valueOf(false), false);
            by.e("load agg data error");
        } finally {
            b.a(o.a).c();
        }
    }

    public static o a(Context arg1) {
        o.a = arg1;
        return o$a.a();
    }

    public void a(f arg3, List<String> arg4) {
        try {
            com.umeng.analytics.pro.a.a(arg3, b.a(o.a).b(), arg4);
        } catch (Exception v0_1) {
            by.e("saveToLimitCKTable exception");
        } finally {
            b.a(o.a).c();
        }
    }

    public void a(f arg3, Map arg4) {
        try {
            com.umeng.analytics.pro.a.a(b.a(o.a).b(), arg4.values());
            arg3.a("success", false);
        } catch (Exception v0_1) {
            by.e("save agg data error");
        } finally {
            b.a(o.a).c();
        }


    }

    public void a(f arg8, String arg9, long arg10, long arg12) {
        try {
            com.umeng.analytics.pro.a.a(b.a(o.a).b(), arg9, arg10, arg12);
            arg8.a("success", false);
        } catch (Exception v0_1) {
            by.e("package size to big or envelopeOverflowPackageCount exception");
        } finally {
            b.a(o.a).c();
        }
    }

    public JSONObject a() {
        JSONObject v0_2 = null;
        try {
            v0_2 = com.umeng.analytics.pro.a.b(b.a(o.a).a());
        } catch (Exception v0_1) {
            by.e("upload agg date error");
        } finally {
            b.a(o.a).c();
        }
        return v0_2;
    }

    public void a(f arg3, boolean arg4) {
        try {
            com.umeng.analytics.pro.a.a(b.a(o.a).b(), arg4, arg3);
        } catch (Exception v0_1) {
            by.e("notifyUploadSuccess error");
        } finally {
            b.a(o.a).c();
        }

    }

    public void b(f arg3, Map arg4) {
        try {
            com.umeng.analytics.pro.a.a(b.a(o.a).b(), arg4, arg3);
        } catch (Exception v0_1) {
            by.e("arrgetated system buffer exception");
        } finally {
            b.a(o.a).c();
        }
    }

    public List b() {
        List v0_2 = null;
        try {
            v0_2 = com.umeng.analytics.pro.a.c(b.a(o.a).a());
        } catch (Exception v0_1) {
            by.e("loadCKToMemory exception");
        } finally {
            b.a(o.a).c();
        }
        return v0_2;
    }

    public JSONObject b(f arg3) {
        JSONObject v0_2 = null;
        try {
            v0_2 = com.umeng.analytics.pro.a.a(arg3, b.a(o.a).a());
        } catch (Exception v0_1) {
            v0_1.printStackTrace();
        } finally {
            b.a(o.a).c();
        }
        return v0_2;
    }

    public void c(f arg3, Map arg4) {
        try {
            com.umeng.analytics.pro.a.a(arg3, b.a(o.a).b(), arg4.values());
        } catch (Exception v0_1) {
            by.e("cacheToData error");
        } finally {
            b.a(o.a).c();
        }

    }
}

